#e
#Title[؉JuC{[V[v]
#Text[F̉J~炷]
#PlayLevel[Extra]
#BGM[.\BGM\th06_14.wav]
#Image[script\img\WbNiCt.png]
#ScriptVersion[2]

script_enemy_main {
    let imgSBoss   =GetCurrentScriptDirectory~".\img\China.png";
    let frame     =  0;
    let frame2 = 0;
    let frame3 = 0;
    let shootSE = GetCurrentScriptDirectory~".\SE\shoot13.wav";
    let Scutin = GetCurrentScriptDirectory~".\img\cutChina.png";

    

  //̓t[𐔂Ă܂B
  let BossY = GetClipMinY + 120;
  //ɂ͓G̓oʒuYĂB
  let MoveF = 180;
  //ɂ͉t[Ɉړ邩ĂB
  
  function Qif (YesR,NoR,Quest) {
  //Qif(̕ԓ,s̕ԓ,)
  if (Quest) {return(YesR)}else{return(NoR)}
  }
   
    @Initialize {
         SetLife(300);
	 SetDamageRate(10,0);//_[W10%ɐݒ
         SetScore(1500000);//XyJ[h{[iX30000ɐݒ
         SetTimer(60);//Ԑ60bɐݒ
         LoadGraphic(imgSBoss);
         SetTexture(imgSBoss);
         SetGraphicRect(0, 0, 44, 86);
	 SetInvincibility(30);//G30t[Gɂ
	 SetMovePosition02(GetCenterX(),60,60);
         CutIn(KOUMA,"ؕuC{[V[v",Scutin,0,0,256,256);//XyJ[h\
    }

    @MainLoop {
frame++;
frame2++;
frame3++;
        SetCollisionA(GetX, GetY, 24);
        SetCollisionB(GetX, GetY, 24);
  if((frame2-60)%MoveF==0&&MoveF!=0){
  SetMovePosition02(GetX()+(Qif(1,-1,GetX<=GetPlayerX)*rand(40,60)),rand(BossY-40,BossY+40),60);
  }
 if (frame==50){  
PlaySE(shootSE);
let angle = rand(70,110);
loop(40){
SetShotDirectionType(PLAYER);
CreateShot01(GetX(),GetY(),2,angle,PURPLE05,0);
angle += 9;}
frame=0;
 }

if(frame3==10){
SetShotDirectionType(ABSOLUTE);
CreateShot02(rand(-10,400),rand(-5,50),1,90,0.1,3,RED23,20);
CreateShot02(rand(-10,400),rand(-5,50),1,90,0.1,3,BLUE23,20);
CreateShot02(rand(-10,400),rand(-5,50),1,90,0.1,3,GREEN23,20);
CreateShot02(rand(-10,400),rand(-5,50),1,90,0.1,3,YELLOW23,20);
CreateShot02(rand(-10,400),rand(-5,50),1,90,0.1,3,AQUA23,20);
CreateShot02(rand(-10,400),rand(-5,50),1,90,0.1,3,ORANGE23,20);
frame3=0;
	}
}

    @DrawLoop {
        DrawGraphic(GetX, GetY);
    }

    @Finalize {
        DeleteGraphic(imgSBoss);
	DeleteSE(shootSE);
	loop(24){CreateItem(ITEM_SCORE,GetX()+rand(-70,70),GetY()+rand(-70,70));}
    }
}
